const mongoose = require('mongoose')

const Schema = mongoose.Schema

const articleSchema = new Schema({
  userId: String,
  username: String,
  articleId: String,
  articleType: String,
  title: String,
  content: String,
  time: Number,
  viewed: Number,
  reviews: [
    {
      reviewId: String,
      username: String,
      userId: String,
      time: Number,
      content: String,
      mentioned: [String]
    }
  ]

})

module.exports = mongoose.model('Article', articleSchema)